package com.van.serviceImpl;

import java.util.List;

import com.van.dao.UserDao;
import com.van.pojo.User;
import com.van.service.UserService;
import com.van.util.MybatisUtil;

public class UserServiceImp implements UserService{
	private static UserDao userdao = MybatisUtil.getSession().getMapper(UserDao.class);

	@Override
	public List<User> selectAll() {
		List<User> list = userdao.selectAll();
		return list;
	}

	@Override
	public User selectById(int userid) {
		
		return userdao.selectById(userid);
	}

	@Override
	public User selectByUsername(String usernname) {
		// TODO Auto-generated method stub
		return userdao.selectByUsername(usernname);
	}

	@Override
	public void insert(User user) {
		// TODO Auto-generated method stub
		 userdao.insert(user);
	}

	@Override
	public void update(User user) {
		// TODO Auto-generated method stub
		userdao.update(user);
	}

	@Override
	public void delete(User user) {
		// TODO Auto-generated method stub
		userdao.delete(user);
	}

	@Override
	public void deleteByUsername(String username) {
		// TODO Auto-generated method stub
		userdao.deleteByUsername(username);
	}
	
	
}
